package com.xkcoding.https.controller;

    import com.alibaba.fastjson.JSON;
    import com.alibaba.fastjson.TypeReference;
    import org.springframework.util.Assert;
    import org.springframework.util.MultiValueMap;
    import org.springframework.web.bind.annotation.*;
    import org.springframework.web.multipart.MultipartFile;

    import java.io.IOException;
    import java.math.BigDecimal;
    import java.util.ArrayList;
    import java.util.List;

@RestController
@RequestMapping("/api/v1/investor")
public class TestController {

    @GetMapping("/test/{m}")
    public void test(@PathVariable String m){
        BigDecimal bigDecimal = new BigDecimal(m);
        if(true){
            Assert.isTrue(BigDecimal.valueOf(1000L).compareTo(bigDecimal)>=0,"error");
        }
    }

    @PostMapping("/identify")
    public ResultBean<Boolean> identify(@RequestParam("assetsProofFiles") MultipartFile []assetsProofFiles,
                                        @RequestParam("investingProofFiles") MultipartFile []investingProofFiles) throws IOException {

        return new ResultBean<>();
    }

    @GetMapping("/identify/result")
    public ResultBean<IdentifyResultDTO> getIdentifyResult(InvestorIdentifyDTO investorIdentifyDTO) {

        return new ResultBean<>();
    }

    @PostMapping("/cancel/identify")
    public ResultBean<Boolean> cancelIdentification(@RequestBody InvestorIdentifyDTO investorIdentifyDTO) {
        return new ResultBean<>();
    }


    @PostMapping("/professional/confirm")
    public ResultBean<Boolean> professionalConfirm(@RequestBody InvestorIdentifyDTO investorIdentifyDTO) {
        return new ResultBean<>();
    }

    @GetMapping("/status")
    public ResultBean<List<InvestorStatusDTO>> getInvestorStatus(InvestorIdentifyDTO investorIdentifyDTO) {
        ResultBean<List<InvestorStatusDTO>> resultBean = new ResultBean<>();
        ArrayList<InvestorStatusDTO> objects = new ArrayList<>();
        InvestorStatusDTO investorStatusDTO = new InvestorStatusDTO();investorStatusDTO.setInvestorStatus("test");
        objects.add(investorStatusDTO);
        resultBean.setModel(objects);
        return resultBean;
    }
}
